<?php
    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
    date_default_timezone_set('Asia/Shanghai');

    $strCurPath = __DIR__; //__FILE__;

    include $strCurPath . DIRECTORY_SEPARATOR . 'File.class.php';
    include $strCurPath . DIRECTORY_SEPARATOR . 'Tpl.class.php';

    $objTpl = new Tpl($strCurPath . DIRECTORY_SEPARATOR . '/tpl', $strCurPath . DIRECTORY_SEPARATOR . '/tpl_c');

    $objTpl->assign('hello', '你好');
    $objTpl->assign('hello', 'world');

    $arrData = ['Apple', 'Orange', 'Pear', 'Banana', 'Grape'];
    $objTpl->assign('arrData', $arrData);

    $objTpl->assign('timeCode', 3);

    $objTpl->display('index.tpl.html');

    $executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
    echo '<br><br>花费时间 Time Taken: ' . number_format($executionTime, 6) . ' seconds';